<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
		<meta content="yes" name="apple-mobile-web-app-capable"/>
		<meta content="black" name="apple-mobile-web-app-status-bar-style"/>
		<meta content="telephone=no" name="format-detection"/>
		<title>活动-结束页面</title>
		<link rel="stylesheet" type="text/css" href="css/activity-end.css"/>
		<link rel="stylesheet" href="css/animate.min.css">
		<link rel="stylesheet" href="fonts/fontCss.css">
		<link rel="stylesheet" href="css/share.css">
		<link rel="stylesheet" href="css/scrollmenu.css">
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script src="js/layer/layer.js"></script>
		<script type="text/javascript" src="js/jquery-jtemplates.js"></script>
		<script type="text/javascript" src="js/common.js"></script>
		<style>textarea{display:none}</style>
		<script>
            $(function () {
                var id = getParam("id");
                $.get('/api/game/info/'+id,function (d) {
                    if(d.code == 1){
                        $('.intro').text(d.data.title);
                    }
                });
            })
            function detail(){
                var id = getParam("id");
                window.location.href = "activity-rule.html?id="+ id;
            }
		</script>
	</head>
	<body class="by">
		<div class="nav">
			<div class="img-close">
				 <a href="/index.html">
					<img src="./img/btn_nav_back@3x.png" />
				 </a>
			 </div>
			<div class="intro">
				浓情中秋  感恩大礼
			</div>
			 <div class="img-share">
			 	 <a href="#" class="share-btn">
			 		<img src="./img/btn_nav_share@3x.png" />
			 	 </a>
			  </div>
		</div>
		<div class="main">
			<div class="imme_end">
				<img src="img/img_huodongjieshu@3x.png" />
			</div>
			<div>
				<div class="imme_moon">
					<img src="img/img_bg_moon.png" />
				</div>
				<div class="wdjp"><a href="javascript:myhits();"><img src="img/img_wodejiangpin@3x.png" /></a></div>
				<div class="hdjs"><a href="javascript:detail();"><img src="img/img_huodongguize@3x.png" /></a></div>
			</div>
			<!--我的中奖纪录 start 勿删除-->
			<div class="wdtca" id="wdtca">
				<div id="wdtc" class="wdtc" onclick="close_img();">
					<img  src="img/img_tc_wdtc@3x.png" />
				</div>
				<div class="scrollDiv2" id="s4">
					<ul id="hits" style="height:250px;">
					</ul>
				</div>
			</div>
			<!--我的中奖纪录 end 勿删除-->
			<!--我的未中奖纪录 start 勿删除-->
			<div class="wdtcnb" id="wdtcnb">
				<div id="wdtcn" class="wdtcn" onclick="close_img1();">
					<img src="img/img_tc_wdtc@3x.png" />
				</div>
				<div class="wdtcn-img">
					<img src="img/img_bq_yihan@3x.png" />
				</div>
				<div class="wdtcn-text">
					很遗憾，您未中奖
				</div>
			</div>
			<!--我的未中奖纪录 end 勿删除-->
		</div>
		
		<div class="share_box shar_box_center">
			
				<a href="" target="_blank">
					<img style="width: 47px;height: 47px;" src="img/btn_share_weixin.png" />
					<br /><span style="font-size: 14px;">微信</span>
				</a>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="" target="_blank">
					<img style="width: 47px;height: 47px;" src="img/btn_share_qq.png" />
					<br /><span style="font-size: 14px;">QQ</span>
				</a>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="" target="_blank">
					<img style="width: 47px;height: 47px;" src="img/btn_share_pengyouquan.png" />
					<br /><span style="font-size: 14px;">朋友圈</span>
				</a>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="" target="_blank">
					<img style="width: 47px;height: 47px;" src="img/btn_share_weibo.png" />
					<br /><span style="font-size: 14px;">微博</span>
				</a>
				<div style="width: 100%; height: 1px;background-color: #EDEDED;"></div>
				<div class="share-cancel-btn btn btn-block" style="font-size: 16px;">取消</div>
		</div>
			
		<script type="text/javascript" src="js/jquery-scroll.js"></script>
		<script type="text/javascript" src="js/bscroll.js"></script>
		<script type="text/javascript" src="js/scrollmenu.js"></script>
		<script src="js/share.js"></script>
		<script type="text/javascript">
			function showList2(){
				$("body").scrollmenu({
					type:'',
					// bscroll:true,
					// animateIn:'bounceIn',
					// animateOut:'bounceOut',
					click:function(ret){
						if(ret.hasHref){
							return
						}else{
							// switch (ret.index){
							// 	case 0:
							// 	alert(0);
							// 	break;
							// }
							alert(JSON.stringify(ret));
						}
					}
				});
			}
		</script>
		<script>

            function myhits(){
                var id = getParam("id");
                $.get('/api/user/hit/'+id+'/1/100',function (d) {
                    if(d.code == 1){
                        if(d.data.items.length == 0){
                            $('.wdtcn-text').text('很遗憾，您未中奖');
                            wdjzn();
                        }else{
                            d.data.items.forEach(function(v,i){
                                $('#hits').append(
                                    '<li>' +
                                    '<span style="width:100px;color:#FBF102;float:left">'+v.name.substr(0,5) + (v.name.length >5 ? '...' : '')+'  </span> ' +
                                    '<span style="width:100px;color:#FFFFFF;margin-left:20px">'+v.hittime.substr(0,10)+'</span>' +
                                    '</li>');
                            })
                            // $("#hits").processTemplate(d.data.items);
                            wdjz();
                        }
                    }else{
                        $('.wdtcn-text').text(d.msg);
                        wdjz();
                    }
                });
            }

			//我的中奖纪录
			function wdjz(){
				
				$('#wdtca').show();
				layer.open({
				  type: 1,
				  title: false,
				  closeBtn: 0,
				  area: ['280px', '300px'],
				  skin: 'layui-layer-nobg',
				  shade: 0.7,
				  scrollbar: false,
				  content: $('#wdtca')
				  
				});
			}
			function close_img(){
				layer.closeAll();
				$('#wdtca').hide();
			}
			
			//我的未中奖纪录
			function wdjzn(){
				
				$('#wdtcnb').show();
				layer.open({
				  type: 1,
				  title: false,
				  closeBtn: 0,
				  area: ['280px', '300px'],
				  skin: 'layui-layer-nobg',
				  shade: 0.7,
				  scrollbar: false,
				  content: $('#wdtcnb')
				});
			}
			function close_img1(){
				layer.closeAll();
				$('#wdtcnb').hide();
			}
			
		</script>
		<script type="text/javascript">
			//滚动插件
			(function($){
				$.fn.extend({
					Scroll:function(opt,callback){
							//参数初始化
							if(!opt) var opt={};
							var _this=this.eq(0).find("ul:first");
							var lineH=_this.find("li:first").height(), //获取行高
								line=opt.line?parseInt(opt.line,10):parseInt(this.height()/lineH,10), //每次滚动的行数，默认为一屏，即父容器高度
								speed=opt.speed?parseInt(opt.speed,10):500, //卷动速度，数值越大，速度越慢（毫秒）
								timer=opt.timer?parseInt(opt.timer,10):3000; //滚动的时间间隔（毫秒）
							if(line==0) line=1;
							var upHeight=0-line*lineH;
							//滚动函数
							scrollUp=function(){
									_this.animate({
											marginTop:upHeight
									},speed,function(){
											for(i=1;i<=line;i++){
													_this.find("li:first").appendTo(_this);
											}
											_this.css({marginTop:0});
									});
							}
							//鼠标事件绑定
							_this.hover(function(){
									clearInterval(timerID);
							},function(){
									timerID=setInterval("scrollUp()",timer);
							}).mouseout();
					}       
				});
			})(jQuery);
			
			$(document).ready(function(){
				$("#s4").Scroll({line:6,speed:500,timer:4000});
			});
			</script>
	</body>
</html>
